package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.OiCountdown;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OiCountdownRepository extends JpaRepository<OiCountdown,Integer> {

    @Query(value = "select id,class_id,event_content,DATE_FORMAT(event_time,'%Y-%m-%d %T') event_time,DATE_FORMAT(add_time,'%Y-%m-%d %T')add_time,topping from oi_countdown where class_id=?1 and topping = ?2",nativeQuery = true)
    OiCountdown findByClassIdAndTopping(Integer classId, int topping);
}
